package edu.scau.divineplace.aggregator;

import cn.hutool.core.util.IdUtil;
import edu.scau.divineplace.entity.query.AccountQuery;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.params.aggregator.ArgumentsAccessor;
import org.junit.jupiter.params.aggregator.ArgumentsAggregator;

/**
 * @Author: x1aolone
 * @Date: 2021/7/22 22:47
 */
public class AccountQueryAggregator implements ArgumentsAggregator {
    @Override
    public AccountQuery aggregateArguments(ArgumentsAccessor arguments, ParameterContext context) {
        AccountQuery query = new AccountQuery();
        query.setName(arguments.getString(0));
        query.setPassword(arguments.getString(1));
        query.setTelephone(arguments.getString(2));
        query.setAvatar(IdUtil.randomUUID());
        return query;
    }
}
